package com.proton.carepatchtemp.database.table;


import com.proton.carepatchtemp.constant.Extras;
import com.proton.carepatchtemp.constant.Settings;
import com.proton.carepatchtemp.utils.GsonUtils;

import java.io.Serializable;

public class RptConfig implements Serializable {
    //默认为true 非默认为false
    public boolean isdefaut = true;
    //报警间隔
    public long alertTime = Settings.D_ALERT_TIME;
    public int type = Extras.RPT_TYPE_TEMP;
    protected long dvcid = 0;
    private long duration = 0;
    private float min = Settings.DEFAULT_MIN;
    private float max = Settings.DEFAULT_MAX;
    private long profileid = 0;
    private String name = "";

    public RptConfig() {
        this(true);
    }

    public RptConfig(boolean isdefault) {
        this.isdefaut = false;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public float getMin() {
        return min;
    }

    public void setMin(float min) {
        this.min = min;
    }

    public float getMax() {
        return max;
    }

    public void setMax(float max) {
        this.max = max;
    }

    public long getProfileid() {
        return profileid;
    }

    public void setProfileid(long profileid) {
        this.profileid = profileid;
    }

    public String toString() {
//        return "{" +
//                "duration=" + duration +
//                ", min=" + min +
//                ", max=" + max +
//                ", profileid=" + profileid +
//                ", name='" + name +
//                '}';
        return GsonUtils.getGson().toJson(RptConfig.this, RptConfig.class);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getDvcid() {
        return dvcid;
    }

    public void setDvcid(long dvcid) {
        this.dvcid = dvcid;
    }
}